import type { RouteRecordRaw } from "vue-router";
/**
 * 静态路由（默认路由）
 */
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      hidden: true,
    },
  },

  {
    path: "/404",
    name: "404",
    component: () => import("@/views/error/404.vue"),
    meta: {
      hidden: true,
    },
  },

  {
    path: "/",
    component: () => import("@/layout/index.vue"),
    redirect: "/home",
    children: [
      {
        path: "home",
        name: "Home",
        component: () => import("@/views/home/index.vue"),
        meta: {
          title: "首页",
          icon: "ele-HomeFilled",
        },
      },
    ],
  },
];
/**
 * 定义动态路由
 */
export const allAsyncRoutes: Array<RouteRecordRaw> = [
  {
    path: "/acl",
    name: "Acl",
    component: () => import("@/layout/index.vue"),
    redirect: "/acl/user/list",
    meta: {
      title: "权限管理",
      icon: "ele-Setting",
    },
    children: [
      {
        name: "User",
        path: "/acl/user/list",
        component: () => import("@/views/acl/user/index.vue"),
        meta: {
          title: "用户管理",
        },
      },
      {
        name: "Role",
        path: "/acl/role/list",
        component: () => import("@/views/acl/role/index.vue"),
        meta: {
          title: "角色管理",
        },
      },
      {
        name: "RoleAuth",
        path: "/acl/role/auth",
        component: () => import("@/views/acl/role/roleAuth.vue"),
        meta: {
          title: "角色管理",
          hidden: true,
          activeMenu: "/acl/role/list",
        },
      },
      {
        name: "Permission",
        path: "/acl/permission/list",
        component: () => import("@/views/acl/permission/index.vue"),
        meta: {
          title: "菜单管理",
        },
      },
    ],
  },
  {
    path: "/product",
    component: () => import("@/layout/index.vue"),
    name: "Product",
    meta: {
      title: "商品管理",
      icon: "ele-Goods",
    },
    children: [
      {
        path: "trademark/list",
        component: () => import("@/views/product/trademark/index.vue"),
        name: "Trademark",
        meta: {
          title: "品牌管理",
        },
      },
      {
        path: "attr/list",
        component: () => import("@/views/product/attr/index.vue"),
        name: "Attr",
        meta: {
          title: "平台属性管理",
        },
      },
      {
        path: "spu/list",
        component: () => import("@/views/product/spu/index.vue"),
        name: "Spu",
        meta: {
          title: "Spu管理",
        },
      },
      {
        path: "sku/list",
        component: () => import("@/views/product/sku/index.vue"),
        name: "Sku",
        meta: {
          title: "Sku管理",
        },
      },
    ],
  },
  {
    path:"tryout",
    component:()=>import("@/layout/index.vue"),
    name:'Tryout',
    meta:{
      title:"测试管理",
      icon:'ele-Pointer'
    },
    children:[
      {
        path:'tryoutone/list',
        component:() => import('@/views/tryout/tryoutone/index.vue'),
        name:'Tryoutone',
        meta:{
          title:'测试管理one',
        }
      },
      {
        path:'tryouttwo/list',
        component:() => import('@/views/tryout/tryouttwo/index.vue'),
        name:'Tryouttwo',
        meta:{
          title:'测试管理two'
        }
      }
    ]
  }
];

/**
 * 任意路由
 * 任意路由:后期在注册路由器的时候必须放在最后--一般就是404路由
 */
export const anyRoute = {
  path: "/:pathMatch(.*)",
  name: "Any",
  redirect: "/404",
  meta: {
    hidden: true,
  },
};
